// pages/activity/sendBless.js
// import md5 from '/utils/md5.js';
const app = getApp()
Page({
    data: {
        btnImg: '//resource.160nurse.com/canvas/healthy/img/activity/sendfriend.png',

    },
    onLoad: function (options) {
        console.log(options.order_no)
        var that = this
        // 获取头像和姓名
        var icon = wx.getStorageSync('icon')
        var name = wx.getStorageSync('nickname')
        app.request(app.apiDomain + 'index.php?c=user&a=orderdetail', {
            order_no: options.order_no
        }, res => {
            console.log(res)
            that.setData({
                info: res.data.data,
                icon: icon,
                name: name,
                order_no: options.order_no,
            })
        })
    },
    onShareAppMessage: function () {
        var that = this
        console.log(111);
        var nickName = '';
        var user_id = 0;
        // var time = Date.parse(new Date()).toString();
        // time = time.substr(0, 10);
        try {
            nickName = wx.getStorageSync('nickname');
            user_id = wx.getStorageSync('user_id');
        } catch (e) {}
        console.log(nickName)
        // sign = md5(time+userId+this.data.order_no+'6723d2909ec9fbf969c000e32ff2f514')
        return {
            title: nickName + '送了您一件礼物,快来查收吧~',
            imageUrl: 'https://resource.160nurse.com/canvas/healthy/img/activity/showout_1.png',
            path: '/pages/activity/showBless?user_id=' + user_id + '&order_no=' + this.data.order_no,
        }
    }
})
